from 超市购物功能模块 import *

#超市商品清单
products = [
    {"name": "方便面", "price": 5.5},
    {"name": "火腿肠", "price": 2.5},
    {"name": "矿泉水", "price": 2.0},
    {"name": "空调", "price": 1999.0},
    {"name": "薯片", "price": 5.0},
    {"name": "可乐", "price": 3.0}
]

#空购物车
shopping_cart = []

money = 100000

def shopping_system():

    print("欢迎来到超市购物系统")

    print("您可以进行一下选项：")
    print("1. 查看商品列表")
    print("2. 购物")
    print("3. 查看购物车")
    print("4. 重置购物车")
    print("5. 结算购物车")
    print("6. 输入 Q / q 退出购物")

    while True:
        choice = input("请输入您的选择：")

        if choice == 'Q' or choice == 'q':
            print("退出系统")
            break
        elif choice == "1":
            product_list(products)
            print("输入 【2】 进行购物")

        elif choice == "2":
            shopping(shopping_cart,products)

        elif choice == "3":
            view_cart(shopping_cart)

        elif choice == "4":
            clear_cart(shopping_cart)

        elif choice == "5":
            statement(shopping_cart, money)
            print("输入【Q】/【q】退出")


shopping_system()